"""
import requests,json

# 热门视频榜单
appKey = 'c80ededc0823aa889d7f8aaaaf2d6ece'
apiUrl = 'http://apis.juhe.cn/fapig/douyin/billboard'
size = 50
apitype = "hot_video"

result = requests.get(url=apiUrl, params={"key": appKey, "type": apitype, "size": size})
# result = requests.post(url=apiUrl, data={"key": appKey, "type": type, "size": size})
# print(result)
data = result.json() # text 文本信息  content 原始数据  json json数据(这个方法会直接将json的数据转换为字典)
for data_result in data["result"]:
     print(data_result["title"],data_result["share_url"])

data = result.text
data = json.dumps(json.loads(data), indent="  ", ensure_ascii=False)
print(data)
"""

# #json 转换
import json
#字典转换json数据
dict1 = {"姓名":"李四","年龄":18,"性别":"男","工作":"四级"}
json_result=json.dumps(dict1,ensure_ascii=False,indent=' ')
print(json_result)
# json 数据转换字典
dict_result = json.loads(json_result)
print(dict_result)
print(type(dict_result))